package live.betterman.api.demo;


import lombok.Data;

import java.util.LinkedList;
import java.util.concurrent.ConcurrentSkipListSet;

@Data
public class Line {
    public Line() {
        carts = new LinkedList<>();
    }

    private LinkedList<Cart> carts;

    // 所有正在移动的小车
    private ConcurrentSkipListSet<Integer> cartsToMove = new ConcurrentSkipListSet<>();

    public void addCart(Cart cart) {
        if (carts == null) {
            carts = new LinkedList<>();
        }
        carts.add(cart);
    }
}
